<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no" />
        <link rel="stylesheet" href="./css_js/swiper-bundle.min.css" />
        <script src="./css_js/swiper-bundle.min.js"></script>
        <!-- <link rel="stylesheet" href="https://unpkg.com/swiper/swiper-bundle.min.css" />
		<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script> -->
        <title>Document</title>
        <style>
            .swiper {
                width: 650px;
                height: 300px;
                background-color: grey;
            }
            .swiper-slide img{
                width: 100%;
                height: 100%;
            }
        </style>
    </head>
    <body>
        <div class="swiper">
            <div class="swiper-wrapper">
                <div class="swiper-slide"><img src="./img/bn1.jpg" alt=""></div>
                <div class="swiper-slide"><img src="./img/bn2.webp" alt=""></div>
                <div class="swiper-slide"><img src="./img/bn3.webp" alt=""></div>
                <div class="swiper-slide"><img src="./img/bn4.webp" alt=""></div>
                <div class="swiper-slide"><img src="./img/bn5.webp" alt=""></div>
            </div>

            <!-- 如果需要分页器 -->
            <div class="swiper-pagination"></div>

			 <!-- 如果需要导航按钮 -->
			 <div class="swiper-button-prev"></div>
			 <div class="swiper-button-next"></div>
             
			 <!-- 如果需要滚动条 -->
			 <div class="swiper-scrollbar"></div>
        </div>
    </body>
    <script>
        // 用构造函数创建实例，形参分别是选择器对象和相关配置信息，以对象形式传递，根据不同属性实现不同效果
        var mySwiper = new Swiper(".swiper", {
            // direction: "vertical", // 垂直切换选项
            autoplay: true,//自动播放
            loop: true, // 循环模式选项
            // 如果需要分页器
            pagination: {
                el: ".swiper-pagination",
            },
            // 如果需要前进后退按钮
            navigation: {
                nextEl: ".swiper-button-next",
                prevEl: ".swiper-button-prev",
            },

            // 如果需要滚动条
            scrollbar: {
                el: ".swiper-scrollbar",
            },
        });
    </script>
</html>
